/*
package com.example.administrator.basedemos.base;

import com.sjzs.my.sjzs.bean.AppInfo;
import com.sjzs.my.sjzs.bean.BaseBean;
import com.sjzs.my.sjzs.bean.IndexBean;
import com.sjzs.my.sjzs.bean.LoginBean;
import com.sjzs.my.sjzs.bean.LoginRequestBean;
import com.sjzs.my.sjzs.bean.PageBean;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

*/
/**
 * Created by lenovo on 2017/6/9.
 *//*


public interface APIService {
    public static final String BASE_URL = "http://112.124.22.238:8081/course_api/cniaoplay/";

    //    @GET("featured")
    //    public Call<PageBean<AppInfo>> getApps(@Query("p") String jsonParam);
http://112.124.22.238:8081/course_api/cniaoplay/featured?p={'page':0}
    //http://112.124.22.238:8081/course_api/cniaoplay/index?p={2:%22HU}
    @GET("featured2")
    Observable<BaseBean<PageBean<AppInfo>>> getApps(@Query("p") String jsonParam);

    //http://112.124.22.238:8081/course_api/cniaoplay/index?p={2:%22HU}
    @GET("index")
    Observable<BaseBean<IndexBean>> index();

    //排行榜  因为有分页 所有必须添加一层pagebean调用他的是不是又下一页的属性
    @GET("toplist")
    Observable<BaseBean<PageBean<AppInfo>>> getTopList(@Query("page") int page);

    @GET("game")
    Observable<BaseBean<PageBean<AppInfo>>> getGames(@Query("page") int page);

    //{"phone":"","password":""}
    @POST("login")
    Observable<BaseBean<LoginBean>> login(@Body LoginRequestBean bean);


    //    public static final MediaType JSON
    //            = MediaType.parse("application/json; charset=utf-8");
    //
    //    OkHttpClient client = new OkHttpClient();
    //
    //    String post(String url, String json) throws IOException {
    //        RequestBody body = RequestBody.create(JSON, json);
    //        Request request = new Request.Builder()
    //                .url(url)
    //                .post(body)
    //                .build();
    //        Response response = client.newCall(request).execute();
    //        return response.body().string();
    //    }


    @FormUrlEncoded // FormBody
    @POST("login")
    void login2(@Field("phone") String phone);
    //
    //    FormBody.Builder builder = new FormBody.Builder();
    //    builder.addEncoded("phone","");
    //    body = builde.build();
    //    Request request = new Request.Builder()
    //                .url(url)
    //                .post(body)
    //                .build();
    //        Response response = client.newCall(request).execute();
    //        return response.body().string();

    //  MediaType JSON = MediaType.parse("application/json; charset=utf-8");
    //String BASE_URL = "http://112.124.22.238:8081/course_api/cniaoplay/";
    */
/*
     * 获取推荐界面内容
     * @param jsonParam
     * @return
     *//*

       @GET("featured")
       Call<PageBean<AppInfo>> getApps(@Query("p") String jsonParam);
       @GET("featured2")
       Observable<BaseBean<PageBean<AppInfo>>> getApps (@Query("p") String jsonParam);//p={'page':0}  传入josn数据就是=xxx

       @GET("index")
       Observable<BaseBean<PageBean<AppInfo>>> index ( );

       @GET("toplist")
       Observable<BaseBean<PageBean<AppInfo>>> toplist (@Query("page") int page);//{page:0}  直接传入id 就是{"page":0}

    */
/*
     * 登录用户 json-body形式
     * @param
     * @return
     * 默认会将bean转为json格式字符串
     *//*

    {"mobile":"123456","password":"123456"}
     @POST("login")
     Observer<BaseBean<AppInfo>> login(@Body UserBean bean);*//*

     //创建client
      OkHttpClient client = new OkHttpClient( );
      String json;
      //创建body----- post body方式
      RequestBody body =  RequestBody.create(JSON,"");
      //创建request 绑定 body
      Request request = new Request.Builder( )
              .post(body)
              .build( );
      Response execute = client.newCall(request).execute( );//执行请求*//*


   /*
     * 登录用户 表单形式
     * @param
     * @return
     */

/*  @FormUrlEncoded
    @POST("login")
    Observer<BaseBean<AppInfo>> login(@Field("mobile") String mobile,@Field("password") String password);*//*
*/


/*  //form表单提交方式
        FormBody.Builder builder = new FormBody.Builder();
        builder.add("mobile","137126181111");
        builder.add("password","137126181111");
        FormBody formBody = builder.build( );
        Request requestForm = new Request
                .Builder( )
                .post(formBody)
                .build( );
         execute = client.newCall(requestForm).execute( );
        return execute.body().toString();//返回数据*//*
*/

/*
     * 获取sns界面的内容
     * @param type
     * @param page
     * @param count
     * @return
     */
/*
    @GET("/v1.0/writes/type/{type}/page/{page}/count/{count}")
    Call<PageBean<AppInfo>> getSnsInfo(@Path("type") int type, @Path("id") int page, @Path("count") int count);


    */
/*
     * 通过header添加 token获取个人信息
     * @param token
     * @return
     */
/*
    @GET("user")
    Call<UserBean> getUser(@Header("Authorization") String token);*//*

}

*/